package com.lancoo.ccas53.schedules;

import com.lancoo.ccas53.service.ScheduleSelectService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author: liufeng
 * @CreateTime: 2024-08-02  11:43
 * @Description:
 */
@Slf4j
@Component
@EnableAsync(proxyTargetClass = true)
public class ScheduleSelectClearSchedule {

    @Resource
    private ScheduleSelectService scheduleSelectService;

    @Scheduled(cron = "0 0 3 * * ?")
    public void removeScheduleSelect() {
        log.info("================系统开启定时任务: 删除课表临时数据 开始================");
        scheduleSelectService.lambdaUpdate().remove();
        log.info("================系统开启定时任务: 删除课表临时数据 结束================");
    }
}
